package com.kitchen.http
{
	import com.kitchen.AbstractProxy;
	
	import flash.net.Responder;

	public class KitchenProxy extends AbstractProxy
	{
		private static var instance:KitchenProxy = null;
		
		public function KitchenProxy()
		{
			super();
			this.name = 'kitchenproxy';
		}
		
		/**
		 * 获取店铺详情
		 * 
		 * @param int shoperId
		 * @param int shopId
		 * @return void
		 * **/
		public function getShopNpcs(shoperId:int, shopId:int):void{
			this.getConnect().call('kitchen.ShopService.getShopNpcs',new Responder(this.resultHandle, this.faultHandle), shoperId, shopId);
			
		}
		
		/**
		 * 获取店主信息
		 * 
		 * @param string token 店主唯一标识
		 * @return void
		 **/
		public function getShoper(token:String):void{
			this.getConnect().call('kitchen.ShoperService.login',new Responder(this.resultHandle, this.faultHandle), token);
		}
		
		/**
		 * 获取店铺信息
		 * 
		 * @param int shoperId 店主id
		 * @param int shopId 店di
		 * @return void
		 **/
		public function getShop(shoperId:int, shopId:int=0):void{
			this.getConnect().call('kitchen.ShopService.getShop', new Responder(this.resultHandle, this.faultHandle), shoperId, shopId);
		}
		
		/**
		 * 移动饰品的位置
		 * 
		 * @param int shopDecoId 饰品id
		 * @param int px x坐标
		 * @param int py y坐标
		 * @return void
		 **/
		public function moveDeco(shopDecoId:int, px:int, py:int):void{
			this.getConnect().call('kitchen.ShopService.decoMove', new Responder(resultHandle, faultHandle), shopDecoId, px, py);
		}
		
		/**
		 * 获取系统装修材料列表
		 * 
		 * @param int ps 装修位置 1.墙壁 2.地板 3.坠饰 4.柜台和垃圾桶
		 * @param int page 页码
		 * @return void
		 **/
		public function getSysDecos(ps:int, page:int):void{
			this.getConnect().call('kitchen.DecorateService.getDecorates', new Responder(resultHandle, faultHandle), ps, page, 5);
		}
		
		/**
		 * 获取系统道具列表
		 * 
		 * @param int ps 装修位置 1.墙壁 2.地板 3.坠饰 4.柜台和垃圾桶
		 * @param int page 页码
		 * @return void
		 **/
		public function getSysProp(page:int):void{
			this.getConnect().call('kitchen.ProperService.getProps',new Responder(this.resultHandle, this.faultHandle), page, 10);
		}
		
		/**
		 * 获取系统食材列表
		 * 
		 * @param int ps 装修位置 1.墙壁 2.地板 3.坠饰 4.柜台和垃圾桶
		 * @param int page 页码
		 * @return void
		 **/
		public function getSysMater(page:int):void{
			this.getConnect().call('kitchen.MaterialService.getMaters', new Responder(this.resultHandle, this.faultHandle), page, 10);
		}
		
		/**
		 * 获取npc素材列表
		 * 
		 * @param int level 等级
		 * @return void
		 **/
		public function getNpcs(level:int):void{
			this.getConnect().call('kitchen.NpcService.getNpc', new Responder(this.resultHandle, this.faultHandle), level);
		}
		
		/**
		 * 单例对象实例画
		 * 
		 * @return KitchenProxy
		 **/
		public static function getInstance():KitchenProxy{
			trace('kitchenproxy instance');
			if(instance == null){
				instance = new KitchenProxy();
			}
			return instance;
		}
	}
}